import request from '../../utils/request'
import {getToken} from '../../utils/token'
const api_name = "role"
const group_name = "oss"

/**分页查询角色*/
export function rolesQuery(condition) {
    return request({
        url: `/${group_name}/${api_name}/query`,
        method: 'POST',
        data: condition,
        headers:{
            "OSS-Token": getToken("ossToken"),
        }
    })
}

/**添加角色*/
export function roleAdd(roleAddData) {
    return request({
        url: `/${group_name}/${api_name}/addrole`,
        method: 'POST',
        data: roleAddData,
        headers:{
            "OSS-Token": getToken("ossToken"),
        }
    })
}

/**删除角色*/
export function roleDel(roleId) {
    return request({
        url: `/${group_name}/${api_name}/del`,
        method: 'GET',
        params: { roleId },
        headers:{
            "OSS-Token": getToken("ossToken"),
        }
    })
}